home *** CD-ROM | disk | FTP | other *** search
/ comtecelectrical.ca / www.comtecelectrical.ca.tar / www.comtecelectrical.ca / infobots / Backup / MSOCache / All Users / 90000409-6000-11D3-8CFE-0150048383C9 / YC561413.CAB / F218_Langbar.chm.D2AF2970_B024_49C3_B6AF_56B4D64B51EA / shared.js < prev    next >
Text File  |  2001-01-25  |  57KB  |  1,491 lines

  1. // Filename: shared.js
  2. // Version shared.js for Whistler
  3. // version post b1
  4.  
  5. //************************************************ Shared components path setting *****************************************
  6. //*******************************************************************************************************************
  7. //  ALWAYS PUT THE NAME OF THE CHM THAT WILL CONTAIN shared.js WHERE YOU SEE ntshared.chm
  8. //  IN LINE TWELVE.     ie:  var sSharedCHM= moniker+"ntshared.chm::/";
  9. //  
  10.  
  11.  var moniker= "";                           
  12.  var sSharedCHM= moniker+"";
  13.  
  14. //  var moniker= "";                  // moniker= ""; for flat files
  15. //  var sSharedCHM= moniker+"";
  16.  
  17. //************************************************ EVENT HANDLING ********************************************
  18. //*******************************************************************************************************************
  19. //  re-directs to the proper event-driven functions.
  20.  
  21. window.onload= loadPage;
  22. document.onclick= onclickTriage;
  23. document.onmouseover= gettingHot;
  24. document.onmouseout= gettingCold;
  25. window.onunload=saveChecklistState;
  26. window.onresize= resizeDiv;
  27.  
  28. window.onbeforeprint = set_to_print;
  29. window.onafterprint = reset_form;
  30.         
  31. //********************************************  USER-DEFINED GLOBAL VARIABLES  ************************************
  32. //********************************************************************************************************************
  33. //  The images listed below can all be changed by the user.
  34.  
  35. var sShortcutTip= "";
  36.  
  37. var gifwithin = false;
  38.  
  39.   
  40.     xmldoc = new ActiveXObject("microsoft.XMLDOM");
  41.     xmldoc.async = false;
  42.     xmldoc.load(sSharedCHM + "alttext.xml");
  43.  
  44.     var Alt_sPreviousTip= xmldoc.getElementsByTagName("sPreviousTip")
  45.     var Alt_sNextTip= xmldoc.getElementsByTagName("sNextTip")
  46.     var Alt_sExpandTip= xmldoc.getElementsByTagName("sExpandTip")
  47.     var Alt_sPopupTip= xmldoc.getElementsByTagName("sPopupTip")
  48.     var hld_path2reuse= xmldoc.getElementsByTagName("path2reuse")
  49.     var hld_path2glossary= xmldoc.getElementsByTagName("path2glossary")
  50.     var hld_rel_gif = xmldoc.getElementsByTagName("reltopgif")
  51.     var hld_chmName = xmldoc.getElementsByTagName("chmName")
  52.     var hld_emailer = xmldoc.getElementsByTagName("emailer")
  53.     var hld_sendtext = xmldoc.getElementsByTagName("sendtext")
  54.     var hld_sendto = xmldoc.getElementsByTagName("sendto")
  55.     
  56.     var sPreviousTip="" + Alt_sPreviousTip.item(0).nodeTypedValue
  57.     var sNextTip="" + Alt_sNextTip.item(0).nodeTypedValue
  58.     var sExpandTip="" + Alt_sExpandTip.item(0).nodeTypedValue
  59.     var sPopupTip="" + Alt_sPopupTip.item(0).nodeTypedValue
  60.     var path2reuse="" + hld_path2reuse.item(0).nodeTypedValue
  61.     var path2glossary="" + hld_path2glossary.item(0).nodeTypedValue
  62.     var rel_gif="" + hld_rel_gif.item(0).nodeTypedValue
  63.     var chmName="" + hld_chmName.item(0).nodeTypedValue+"::/"
  64.     var emailer="" + hld_emailer.item(0).nodeTypedValue
  65.     var sendtext="" + hld_sendtext.item(0).nodeTypedValue
  66.     var sendto="" + hld_sendto.item(0).nodeTypedValue
  67.     
  68. var xmldom = new ActiveXObject("microsoft.XMLDOM");
  69.     xmldom.async = false;
  70.         
  71. var closed = sSharedCHM + "plusCold.gif";            //image used for collapsed item in callExpand()
  72. var closedHot = sSharedCHM + "plusHot.gif";            //hot image used for collapsed item in callExpand()
  73. var expand = sSharedCHM + "minusCold.gif";            //image used for expanded item in callExpand()
  74. var expandHot = sSharedCHM + "minusHot.gif";        //hot image used for expanded item in callExpand()
  75.  
  76. var previousCold= sSharedCHM + "previousCold.gif";
  77. var previousHot= sSharedCHM + "previousHot.gif"; 
  78. var nextCold= sSharedCHM + "nextCold.gif";
  79. var nextHot= sSharedCHM + "nextHot.gif"; 
  80.  
  81. var shortcutCold= sSharedCHM + "shortcutCold.gif";
  82. var shortcutHot= sSharedCHM + "shortcutHot.gif";
  83.  
  84. var popupCold= sSharedCHM + "popupCold.gif";
  85. var popupHot= sSharedCHM + "popupHot.gif";
  86.  
  87. var emptyImg= sSharedCHM + "empty.gif";        //image used for empty expand
  88. var noteImg= sSharedCHM + "note.gif";            //image used for notes
  89. var tipImg= sSharedCHM + "tip.gif";            //image used for tips
  90. var warningImg= sSharedCHM + "warning.gif";        //image used for warnings
  91. var cautionImg= sSharedCHM + "caution.gif";        //image used for cautions
  92. var importantImg= sSharedCHM + "important.gif";        //image used for important notice
  93. var relTopicsImg= sSharedCHM + "rel_top.gif";        //image used for important notice
  94.  
  95. var branchImg= sSharedCHM + "elle.gif";
  96. var branchImg_RTL= sSharedCHM + "elle_rtl.gif";
  97.  
  98.  
  99. //********************************************  GLOBAL VARIABLES  ******************************************
  100. //********************************************************************************************************
  101.  
  102. var joejoe = false;
  103. var printing = "FALSE";
  104. var single = "FALSE";
  105. var scroller = "FALSE";
  106. var valet = "FALSE";
  107. var isRTL= (document.dir=="rtl");
  108. var imgStyleRTL= ""; 
  109.       if (isRTL) imgStyleRTL=" style='filter:flipH' ";
  110.  
  111. var sActX_TDC= "CLASSID='CLSID:333C7BC4-460F-11D0-BC04-0080C7055A83'";        //Tabular Data Control  for  reusable text data
  112. var sSharedReusableTextFile= sSharedCHM + "reusable.xml";                                        // common reusable text file
  113. var sSharedReusableTextFileRecord= "para";                                                        //reusable text record
  114.  
  115. var numbers= /\d/g;                //javascript regular expression
  116. var spaces= /\s/g;                //javascript regular expression
  117. var semicolon= /;/g;            //javascript regular expression
  118.  
  119. var isIE5 = (navigator.appVersion.indexOf("MSIE 5")>0) || (navigator.appVersion.indexOf("MSIE")>0 && parseInt(navigator.appVersion)> 4);
  120. var isIE55 = (navigator.appVersion.indexOf("MSIE 5.5")>0);
  121. var isIE6 = (navigator.appVersion.indexOf("MSIE 6")>0);
  122.  
  123. var isPersistent= false;
  124.  
  125. //********************************************  INITIALIZATION  *************************************************
  126. //******************************************************************************************************************
  127. function list_them(){
  128.         
  129.     var envelope = sSharedCHM +'envelope.gif';
  130.     var server = "<DIV Class='FeedbackBar'><SPAN Class='webOnly'><IMG  SRC=" + envelope + " ALT='' BORDER='0'></SPAN><SPAN Class='webOnly' Style='position:relative; top:-1; left:1; color:#333333;'> " + sendtext + " "; 
  131.     server += "<a href='mailto:" + sendto + "?subject=HELP: ";
  132.     server += document.title + "'";
  133.     server += ">" + sendto + "</a></SPAN></DIV>";
  134.     
  135.     var i;
  136.  
  137.     for (i=0; i < document.all.length; i++){
  138.         if ((document.all[i].tagName == "P") ||
  139.             (document.all[i].tagName == "H1")||
  140.             (document.all[i].tagName == "H6")){
  141.             document.all[i].outerHTML = server + document.all[i].outerHTML;
  142.             i = document.all.length;
  143.             }
  144.         }
  145. }
  146. //*** loadPage **********************************************************************************************
  147. //  Adds the default image tags and re-usable text to the HTML page.
  148.  
  149. function loadPage(){
  150. if (printing == "TRUE") return;
  151.  
  152. if (emailer == "yes" ) list_them();
  153.  
  154. isPersistent= (document.all.item("checklist")!=null) && ((isIE5) || (isIE6));
  155.  
  156.   setPreviousNext();
  157.   
  158.   resizeDiv();
  159.   if (isPersistent) getChecklistState();
  160.   addReusableText();
  161.   insertImages();
  162. }
  163.  
  164. //****** setPreviousNext  ************************************************************************ ********************************************************************************************* 
  165. // insert previous/next navbar
  166. // called by: <div id="nav">@@HTMLsequenceFile.txt or .lst@@</div>
  167.  
  168. function setPreviousNext(){
  169.  
  170.  
  171.   var oNav = document.all.item("nav");
  172.         if (oNav == null ) return;
  173.   
  174.   var sPreviousALT= sPreviousTip;
  175.   var sNextALT= sNextTip;
  176.   var sHTMLfile= oNav.innerHTML;
  177.  
  178.   var imgPrev= "<IMG SRC='"+previousCold+"' BORDER=0 ALT='"+ sPreviousALT +"' ALIGN='top' "+ imgStyleRTL +">";
  179.   var imgNext= "<IMG SRC='"+nextCold+"' BORDER=0 ALT='"+ sNextALT  + "' ALIGN='top' "+ imgStyleRTL +">";
  180.   
  181.   var previousNextObject= "<OBJECT ID='HTMlist' WIDTH=100 HEIGHT=51 " + sActX_TDC +"><param name='DataURL' value='"
  182.         +sHTMLfile +"'><param name='UseHeader' value=True></OBJECT>";
  183.       
  184.         oNav.innerHTML= "<TABLE WIDTH='100%' STYLE='margin-top:0;' cellspacing=0>"
  185.         + "<TR><TD style='text-align=left; background-color:transparent'><A ID='previousLink' HREF='#' REL='previous' CLASS='navbar'>"
  186.         +imgPrev + "</A></TD><TD width='100%' align='center'></td><TD style='text-align=right; background-color:transparent'><A ID='nextLink' HREF='#' REL='next' CLASS='navbar'>"
  187.         +imgNext+ "</A></TD></TR></TABLE>";
  188.                     
  189.       document.body.innerHTML= document.body.innerHTML +  previousNextObject;
  190.       findPageSeq();
  191.       if (printing == "TRUE") return;
  192.       var  thisLoc= document.location.href +"#";
  193.  
  194.       if (previousLink.href== thisLoc) previousLink.style.display="none";
  195.       else  previousLink.style.display="block";
  196.  
  197.       if (nextLink.href== thisLoc) nextLink.style.display="none";
  198.       else  nextLink.style.display="block";
  199.       
  200. }
  201.  
  202. function findPageSeq() {
  203.  
  204. var rs= HTMlist.recordset;
  205. var thisLoc= document.location.href;
  206. var iLoc= thisLoc.lastIndexOf("/");
  207.  
  208.     if (iLoc > 0) thisLoc= thisLoc.substring(iLoc+1, thisLoc.length);
  209.     
  210.     
  211.     if (nav.style == "[object]") {
  212.                 nav.style.visibility="hidden";
  213.                 printing = "FALSE";
  214.                 }
  215.         else
  216.             {
  217.                 printing = "TRUE";
  218.                 return;
  219.             }
  220.     
  221.        
  222.     rs.moveFirst();
  223.        
  224.     while (!rs.EOF) {
  225.           if (thisLoc == rs.fields("HTMfiles").value){
  226.               nav.style.visibility="visible"; 
  227.                 rs.MoveNext();
  228.               break;
  229.           }
  230.           previousLink.href=rs.fields("HTMfiles").value;      
  231.           rs.moveNext();
  232.      }
  233.                 
  234.       if (!rs.EOF) nextLink.href=rs.fields("HTMfiles").value;
  235. }
  236.     
  237. //******Re-usable text ********************************************************************************************* 
  238. // Inserts the Tabular Data Control (TDC) object at the end of the page 
  239. // Inserts "re-usable text" from the txt file at: <span id="@@CHM_name@@@@index#@@" class="reuse"></span>
  240. // e.g.<span id="printing4" class="reuse"></span> for record#4 in the printing.txt in printing.chm.
  241.  
  242. //function addReusableText(){
  243. //var ntsharedAdded= false;                    // make sure the object is only added once
  244. //var CHMspecificAdded= false;                // make sure the object is only added once
  245. //var coll = document.all.tags("SPAN");
  246. //var sIndex,sRecord,sFile,sFileID,dataBindingObject;
  247. //var loaded = false;
  248.     
  249. //    xsldoc = new ActiveXObject("microsoft.XMLDOM");
  250. //    xmldoc = new ActiveXObject("microsoft.XMLDOM");
  251. //    xmldoc.async = false;
  252.         
  253. //     for (var i=0; i< coll.length; i++)                                   
  254. //         if (coll[i].className.toLowerCase()=="reuse"){
  255.     //         if (isRTL) coll[i].dir= "rtl";
  256.     //         
  257.     //         if (coll[i].id == null) return;
  258.              
  259.        //         sFile= coll[i].id.toLowerCase();
  260.              
  261.         //     sFileID= sFile;
  262.         //     var sText = "X";
  263.         //     var o = 0;    
  264.         //    xmldoc.load(path2reuse + "reusable.xml");
  265.         //    xsldoc.load(path2reuse + "formatter.xsl");
  266.         //    node = xmldoc.selectSingleNode("glossary/glossSection/entry[@entryID='" + sFileID + "']");
  267.         //    if(node!=null){
  268.         //        alert("hhh")
  269.         //        sText = " " + node.transformNode(xsldoc);
  270.         //        }
  271.         //    coll[i].innerHTML= sText;
  272. //    }           
  273. //}
  274. function addReusableText(){
  275. var ntsharedAdded= false;                    // make sure the object is only added once
  276. var CHMspecificAdded= false;                // make sure the object is only added once
  277. var coll = document.all.tags("SPAN");
  278. var sIndex,sRecord,sFile,sFileID,dataBindingObject;
  279. var loaded = false;
  280.  
  281.     xmldoc = new ActiveXObject("microsoft.XMLDOM");
  282.     xmldoc.async = false;
  283.         
  284.      for (var i=0; i< coll.length; i++)                                   
  285.           if (coll[i].className.toLowerCase()=="reuse"){
  286.              if (isRTL) coll[i].dir= "rtl";
  287.              
  288.              if (coll[i].id == null) return;
  289.              
  290.                 sFile= coll[i].id.toLowerCase();
  291.              
  292.              sFileID= sFile;
  293.              sFile= sFile.replace(numbers,"");
  294.              
  295.              if (loaded != sFile){
  296.                  xmldoc.load(path2reuse + "reusable.xml");
  297.                 objXMLDOMNodeKey = xmldoc.getElementsByTagName("term");
  298.                  objXMLDOMNodeInsert = xmldoc.getElementsByTagName("para");
  299.                 loaded = sFile;
  300.                 }
  301.              
  302.             var o=0;
  303.         
  304.          while (o < objXMLDOMNodeKey.length){
  305.             sIndex = '' + objXMLDOMNodeKey.item(o).nodeTypedValue;
  306.             sIndex = sIndex.toLowerCase()
  307.             sText = '' + objXMLDOMNodeInsert.item(o).nodeTypedValue;
  308.             if (sIndex < sFileID) o++;
  309.                      else {
  310.                      break;
  311.                      }
  312.               }
  313.                 if (sIndex == sFileID) coll[i].innerHTML= sText;
  314.     }           
  315. }
  316.  
  317.  //****** insertImages ********************************************************************************************* 
  318.  //  Inserts shared images in User-Defined Variables section and thumbnails.
  319. var booking = false;
  320. function insertImages(){
  321. if (printing == "FALSE") booking = true;
  322. if (printing == "TRUE" && booking == true ) {
  323.     booking = false;
  324.     return;
  325.     }
  326.  
  327.  
  328. // insert alert icons
  329.   var collP = document.all.tags("P");
  330.   
  331.   for (var i=0; i<collP.length; i++) {
  332.        if (collP[i].className.toLowerCase()=="note")            collP[i].innerHTML ="<img class='alert' src='"+noteImg+"' "+ imgStyleRTL +"> " +     collP[i].innerHTML;
  333.        else if (collP[i].className.toLowerCase()=="warning")    collP[i].innerHTML ="<img class='alert' src='"+warningImg+"'> " +  collP[i].innerHTML;
  334.        else if (collP[i].className.toLowerCase()=="caution")    collP[i].innerHTML ="<img class='alert' src='"+cautionImg+"'> " +  collP[i].innerHTML;
  335.        else if (collP[i].className.toLowerCase()=="tip")        collP[i].innerHTML ="<img class='alert' src='"+tipImg+"'> " +      collP[i].innerHTML;
  336.        else if (collP[i].className.toLowerCase()=="important")  collP[i].innerHTML ="<img class='alert' src='"+importantImg+"'> " + collP[i].innerHTML;
  337.        else if (collP[i].className.toLowerCase()=="empty")      collP[i].innerHTML ="<img class='alert' src='"+emptyImg+"'> " +    collP[i].innerHTML;
  338.        if (collP[i].className.toLowerCase()=="reltopics" && rel_gif == "yes")  {
  339.             collP[i].outerHTML ="<img class='relTopics' src='"+relTopicsImg+"'> " + collP[i].outerHTML;
  340.             }   
  341.           }
  342.   
  343.  
  344.  
  345. //indents for Navigation Tree 
  346. var collUL = document.all.tags("UL");
  347. if (printing != "TRUE") {
  348. for (var i=0; i<collUL.length; i++) {
  349.        var indent= 0;
  350.        if (collUL[i].className.toLowerCase()=="navtree"){
  351.            if (isRTL) collUL[i].style.listStyleImage= "url('" + branchImg_RTL + "')";
  352.            else collUL[i].style.listStyleImage= "url('" + branchImg + "')";
  353.              for (var j = 0; j < collUL[i].children.length; j++)
  354.                 if (collUL[i].children[j].className.toLowerCase()=="branch"){
  355.                     if (isRTL) collUL[i].children[j].style.marginRight= (indent +'em');
  356.                     else   collUL[i].children[j].style.marginLeft= (indent +'em');
  357.                     indent= indent + 0.75;
  358.                 }
  359.       }
  360. }
  361. }
  362.    
  363.   for (var i=0; i < document.anchors.length; i++){
  364.          var imgInsert="";  
  365.          var imgStyle= "";
  366.          var imgSpace= "<span class='space'></span>";      
  367.          var oBefore=document.anchors[i].parentElement.tagName;
  368.          var oAnchor= document.anchors[i].id.toLowerCase();
  369.          
  370. // insert RELTOPICS icons
  371.     if (rel_gif == "yes"){
  372.        if (oAnchor=="reltopics")
  373.                if (document.anchors[i].children.tags("IMG")(0) && document.anchors[i].children.tags("IMG")(0).className.toLowerCase() == "reltopics")
  374.                     imgInsert= "";    // not to re-insert when persistent
  375.             else  imgInsert= "<img class='relTopics' src='"+relTopicsImg+"'>" + imgSpace;
  376.         }
  377.         
  378. // insert SHORTCUT icons
  379.        if (oAnchor=="shortcut") {    
  380.             document.anchors[i].title= sShortcutTip;     
  381.             if (document.anchors[i].children.tags("IMG")(0) && document.anchors[i].children.tags("IMG")(0).className.toLowerCase() == "shortcut")
  382.                     imgInsert= "";    // not to re-insert when persistent
  383.             else  imgInsert= "<img class='shortcut' src='"+shortcutCold+"' "+ imgStyleRTL+ ">" + imgSpace;
  384.         }    
  385.                       
  386. // insert POPUP icons
  387.        else if (oAnchor=="wpopup" || oAnchor=="wpopupweb") document.anchors[i].title= sPopupTip;
  388.        else if (document.anchors[i].className.toLowerCase()=="popupicon")
  389.             if (document.anchors[i].children.tags("IMG")(0) && document.anchors[i].children.tags("IMG")(0).className.toLowerCase() == "popup")
  390.                    imgInsert= "";    // not to re-insert when persistent
  391.             else imgInsert= "<img class='popup' src='"+popupCold+"'>" + imgSpace;
  392.  
  393. // insert EXPAND icons 
  394.        else if (oAnchor=="expand") {
  395.               document.anchors[i].title= sExpandTip;
  396.               if (document.anchors[i].children.tags("IMG")(0) && document.anchors[i].children.tags("IMG")(0).className.toLowerCase() == "expand")
  397.                   imgInsert= "";     // not to re-insert when persistent      
  398.               else{ 
  399.                   if (document.anchors[i].parentElement.offsetLeft == document.anchors[i].offsetLeft) {
  400.                       imgSpace= "<span class='space' style='width:0'></span>";     
  401.                       if (isRTL){ document.anchors[i].parentElement.style.marginRight= "1.5em";  imgStyle=" style=margin-right:'-1.5em'";}
  402.                       else { document.anchors[i].parentElement.style.marginLeft= "1.5em";  imgStyle=" style=margin-left:'-1.5em'";}
  403.                   }      
  404.                   imgInsert= "<img class='expand' src='"+ closed +"' "+imgStyle+">" +imgSpace;
  405.               }
  406.        }
  407.  
  408.  
  409.  
  410. // insert thumbnail images       
  411.        else if (oAnchor=="thumbnail"  || oAnchor=="thumbnailweb"){ 
  412.             var sAltText = document.anchors[i].innerHTML;
  413.             gifwithin = true;
  414.             var sThumbnailText = document.anchors[i].title; 
  415.             var oImg = document.anchors[i].href.toLowerCase();
  416.                   if (oAnchor=="thumbnail") 
  417.                          var sThumbnailImg= moniker + getURL(oImg);
  418.                   else var sThumbnailImg = document.anchors[i].href.toLowerCase();
  419.                   
  420.                  found = sAltText.indexOf("BACKGROUND-COLOR:")
  421.             if (found != -1) {
  422.                 stop_p = sAltText.indexOf(">");
  423.                 sAltText = sAltText.substring(stop_p + 1, sAltText.length);
  424.                 stop_p = sAltText.indexOf("</FONT>");
  425.                 Highlighted = sAltText.substring(0,stop_p)
  426.                 sAltText = Highlighted + sAltText.substring(stop_p + 7, sAltText.length);
  427.                 }
  428.  
  429.                   
  430.                 document.anchors[i].outerHTML = "<DIV id='thumbDiv' class='thumbnail'>"+document.anchors[i].outerHTML+"</div>";
  431.                 document.anchors[i].innerHTML = "<img class='thumbnail' src='" + sThumbnailImg + "' alt= ' " + sAltText + "'><p>" +sThumbnailText+"</p>";
  432.                 
  433.                   if (isRTL) thumbDiv.style.styleFloat= "right";
  434.            }
  435.            
  436.         
  437.         
  438.         document.anchors[i].innerHTML = imgInsert + document.anchors[i].innerHTML;
  439.        if (isRTL) document.anchors[i].dir="rtl";
  440.    }
  441. }
  442.  
  443.  
  444. //***** onclickTriage ****************************************************************************************
  445. // redirects to the appropriate function based on the ID of the clicked <A> tag.
  446.  
  447. function onclickTriage(){
  448. var e= window.event.srcElement;
  449.  
  450. //  if the innerHTML in the <a> tag is encapsulated by a style tag or hightlighted in the word seach,
  451. //  the parentElement is called.
  452.  
  453.     if (printing == "TRUE") {
  454.         printing = "FALSE";
  455.          reset_form();
  456.         }
  457.         
  458.     for (var i=0; i < 5; i++)
  459.            if (e.tagName!="A" && e.parentElement!=null) e= e.parentElement;
  460.     eID= e.id.toLowerCase();
  461.                 
  462.     if (popupOpen) closePopup();
  463.     
  464. // expand image in a new window
  465.     if (eID=="thumbnail" || eID=="pophtm") popNewWindow(e);
  466.     else if (eID=="thumbnailweb") callThumbnailWeb(e);
  467.     else if (eID=="wpopup")    callPopup(e);
  468.     else if (eID=="wpopupweb") callPopupWeb(e);
  469.     else if (eID=="shortcut")  callShortcut(e);
  470.     else if (eID=="reltopics") callRelatedTopics(e);
  471.     else if (eID=="altloc")    callAltLocation(e);
  472.     else if (eID=="expand")    callExpand(e);
  473. // added to support Randy's Quad method code
  474.     else QuadDocumentClick()
  475. // ******************************
  476. }
  477.  
  478.  
  479. //*** gettingHot ****************************************************************************************
  480. // Makes all the required changes for mouseover.
  481.  
  482. function gettingHot() {
  483. var e = window.event.srcElement;
  484.     
  485. // Added to support Quad Method   **************************
  486.     if (e != null && e.firstChild != null && 
  487.         e.firstChild.tagName != null &&
  488.         e.firstChild.tagName.toLowerCase() == "input" && 
  489.         e.firstChild.type.toLowerCase() == "radio" && 
  490.         e.parentElement.className != "indentGray"){
  491.             QuadDocumentMouseOver()
  492.             }
  493.  
  494. // *****************************
  495.  
  496.   if (e.id.toLowerCase()=="cold")  e.id ="hot";
  497.   else if (e.src== previousCold)  e.src = previousHot;
  498.   else if (e.className.toLowerCase()=="navbar" && e.children.tags("IMG")(0).src== previousCold)  e.children.tags("IMG")(0).src= previousHot;
  499.   else if (e.src== nextCold)  e.src = nextHot;
  500.   else if (e.className.toLowerCase()=="navbar" && e.children.tags("IMG")(0).src== nextCold)  e.children.tags("IMG")(0).src= nextHot;
  501.   
  502.   else if (e.className.toLowerCase()=="shortcut" && e.tagName=="IMG")  e.src = shortcutHot;            //<img> tags have a class
  503.   else if (e.id.toLowerCase()=="shortcut")  e.children.tags("IMG")(0).src = shortcutHot;            //<a> tags have an ID
  504.   
  505.   else if (e.className.toLowerCase()=="popup" && e.tagName=="IMG")  e.src = popupHot;            //<img> tags have a class
  506.   else if (e.className.toLowerCase()=="popupicon")  e.children.tags("IMG")(0).src = popupHot;            //<a> tags have an ID
  507.   
  508.   else if ((e.className.toLowerCase()=="expand" && e.tagName=="IMG") ||( e.id.toLowerCase()=="expand")) expandGoesHot(e);
  509.  
  510. }
  511.  
  512. //*** gettingCold **************************************************************************************
  513. // Initial state for mouseout.
  514.  
  515. function gettingCold() {
  516. var e = window.event.srcElement;
  517.  
  518. // Added to support Quad Method   **************************
  519.     if (e != null && e.firstChild != null && 
  520.         e.firstChild.tagName != null &&
  521.         e.firstChild.tagName.toLowerCase() == "input" && 
  522.         e.firstChild.type.toLowerCase() == "radio" && 
  523.         e.parentElement.className != "indentGray"){
  524.             QuadDocumentMouseOver()
  525.             }
  526.  
  527. // *****************************
  528.  
  529.   if (e.id.toLowerCase()=="hot")  e.id ="cold";
  530.   else if (e.src== previousHot)  e.src = previousCold;
  531.   else if (e.className.toLowerCase()=="navbar" && e.children.tags("IMG")(0).src== previousHot)  e.children.tags("IMG")(0).src= previousCold;
  532.   else if (e.src== nextHot)  e.src = nextCold;
  533.   else if (e.className.toLowerCase()=="navbar" && e.children.tags("IMG")(0).src== nextHot)  e.children.tags("IMG")(0).src= nextCold;
  534.   
  535.   else if (e.className.toLowerCase()=="shortcut" && e.tagName=="IMG")   e.src = shortcutCold;        //<img> tags have a class
  536.   else if (e.id.toLowerCase()=="shortcut")  e.children.tags("IMG")(0).src= shortcutCold;             //<a> tags have an ID
  537.   
  538.   else if (e.className.toLowerCase()=="popup" && e.tagName=="IMG")   e.src = popupCold;        //<img> tags have a class
  539.   else if (e.className.toLowerCase()=="popupicon")  e.children.tags("IMG")(0).src= popupCold;             //<a> tags have an ID
  540.   
  541.   else if ((e.className.toLowerCase()=="expand" && e.tagName=="IMG") ||( e.id.toLowerCase()=="expand")) expandGoesCold(e);
  542. }
  543.  
  544. //****************************************** OBJECT CONSTRUCTION **************************************
  545. //*****************************************************************************************************
  546. //  Uses an A tag to pass parameters between an HTML page and this script.
  547. //  Creates an ActiveX Object from these parameters, appends the Object to the end of the page,
  548. //  and clicks it. These objects relate to HTMLHelp environment and information about them can be found on the http://HTMLHelp site.
  549.  
  550. //  Object construction variables *********************************************************************
  551.  
  552. var sParamCHM,sParamFILE, sParamEXEC, sParamMETA,iEND;
  553. var sActX_HH= " type='application/x-oleobject' classid='clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11' ";
  554.  
  555.  
  556. //*** callPopup ***************************************************************************************
  557. // creates an object from an <A> tag HREF, the object inserts a winhelp popup
  558. // called by: <A ID="wPopup" HREF="HELP=@@file_name.hlp@@ TOPIC=@@topic#@@">@@Popup text@@</A>
  559.  
  560. var joker = false;
  561. var blague = true;
  562.  
  563. function callPopup(eventSrc) {
  564. if (popupOpen) closePopup();
  565. var ntsharedAdded= false;                    // make sure the object is only added once
  566. var CHMspecificAdded= false;                // make sure the object is only added once
  567. var coll = document.all.tags("SPAN");
  568. var sIndex,sText=" ",sFile,sFileID,dataBindingObject;
  569.  
  570.      var e= eventSrc;
  571.      var eH= unescape(e);
  572.      eH = eH.toLowerCase();
  573.      var eH_= eH.toLowerCase();
  574.      
  575.      if(event){
  576.          event.returnValue = false;
  577.         }
  578.      found = false;
  579.                                                        
  580.        var iTOPIC = eH.lastIndexOf("topic=");
  581.      if (iTOPIC==-1) return;
  582.      sParamTOPIC = eH.substring((iTOPIC+6),eH.length);
  583.      
  584.      if (!joejoe){
  585.         xmldom.load(path2glossary + "glossary.xml");
  586.         joejoe = true;
  587.         }
  588.          
  589.         var o=0;
  590.         var node = "";    
  591.         node = xmldom.selectSingleNode("glossary/glossSection/entry[@entryID='" + sParamTOPIC + "']");
  592.                     
  593.         if(node!=null)
  594.             {
  595.             
  596.             found = true;
  597.             var ralf = "";
  598.             ralf = node.getElementsByTagName("term")
  599.             sText = "<DIV CLASS='PopTerm'>" + ralf.item(0).nodeTypedValue + "</DIV>";
  600.             ralf = node.getElementsByTagName("para")
  601.             sText = sText + "<DIV CLASS='PopDef'>" + ralf.item(0).nodeTypedValue; + "</DIV>"
  602.             
  603.             seealsos = node.getElementsByTagName("seeAlso");
  604.             var o=0;
  605.                         
  606.             while (o < seealsos.length){
  607.                 sIndex = seealsos.item(o).getAttribute("seeAlsoTermID");
  608.                 node = xmldom.selectSingleNode("glossary/glossSection/entry[@entryID='" + sIndex + "']");
  609.                 ralf = node.getElementsByTagName("term");
  610.                 sTerm = ralf.item(0).nodeTypedValue;
  611.                 if (o == 0) {
  612.                     sText = sText + "<DIV CLASS='PopSeeAlso'>See Also: "
  613.                     // sIndex = "<Input type=submit tabindex=1 value=hhhh onclick='jscript:alert(oPopup.sIndex.innerHTML)'>"
  614.                     sIndex = "<A ID='wPopup' HREF='HELP=glossary.hlp TOPIC=" + sIndex + "' TABINDEX='1'>" + sTerm + "</a>"
  615.                     }
  616.                 else
  617.                     {
  618.                     sIndex = ", <A ID='wPopup' HREF='HELP=glossary.hlp TOPIC=" + sIndex + "' TABINDEX='1'>" + sTerm + "</a>"
  619.                     }
  620.                 o++;
  621.                 sText = sText + sIndex 
  622.                 }
  623.             }
  624.             
  625.             if ((isIE55 || isIE6) && found){
  626.                 var oPopup = false
  627.                 var oPopup = window.createPopup();
  628.                  var strScript = "<script language='JScript'> function clickPopup(){if (event.srcElement.tagName.toLowerCase() == 'a') parent.callPopup(event.srcElement.href); window.PopObject.hide(); return false;}</script>";
  629.                   var strDoc = oPopup.document.body.outerHTML.toLowerCase()
  630.                 
  631.                   oPopup.document.write(strDoc.replace("></body>", " onclick=\"clickPopup()\">" + strScript + "</body>"));
  632.                 //oPopup.document.write(strDoc.replace("></body>", " onclick=\"clickPopup()\, onkeypress=\"process_closePopup()\">" + strScript + "</body>"));
  633.                     oPopup.document.createStyleSheet(sSharedCHM + "coUA.css");    // Apply the stylesheet.
  634.                 var oPopBody = oPopup.document.body;
  635.                 
  636.                 //oPopBody.style.backgroundColor = '#FFFFCC';
  637.                 
  638.                   // oPopBody.style.border = "solid black 1px";
  639.                   oPopBody.style.margin = "0 0 0 0";
  640.                 if (isRTL) oPopBody.innerHTML = "<DIV DIR='RTL' class='XMLPopup'>" + sText + "</DIV>"           // need to add the style class here.
  641.                 else oPopBody.innerHTML = "<DIV class='XMLPopup'>" + sText + "</DIV>"
  642.                 if (window.event){
  643.                     joker = window.event.srcElement;
  644.                     }
  645.                 oPopup.show(0, 0, 400, 8, joker);    // Show the popup at an arbitrary size.
  646.                 var textSize = oPopBody.createTextRange();
  647.                 var wPop = textSize.boundingWidth + oPopBody.offsetWidth - oPopBody.clientWidth;    // Get the size of the text.
  648.                 var hPop = oPopBody.scrollHeight;
  649.                 oPopup.hide();
  650.                 oPopup.document.parentWindow.PopParent = window;
  651.                   oPopup.document.parentWindow.PopObject = oPopup;
  652.                 // oPopup.focus();
  653.                   oPopup.show(0, 1, wPop + 10, hPop, joker);
  654.                 //oPopup.document.focus(oPopup.document.body.JOKER);    
  655.                 return;
  656.                 }
  657.             
  658.             if (found){
  659.                 if (blague){
  660.                 document.body.insertAdjacentHTML("beforeEnd", "<DIV id='wPopupWeb' CLASS='popup'>" + sText + "</DIV>");
  661.                 blague = false;
  662.                 }
  663.                 window.wPopupWeb.innerHTML = sText;
  664.                 callPopupWeb(e);
  665.                 return;
  666.                 }
  667.                   
  668.    var iTOPIC = eH_.lastIndexOf("topic=");
  669.         if (iTOPIC==-1) return;
  670.         sParamTOPIC = eH.substring((iTOPIC+6),eH.length);          // extracts the topic for item2
  671.         
  672.   var iHELP = eH_.lastIndexOf("help=");
  673.         if (iHELP==-1) return;
  674.         sParamHELP = eH.substring(iHELP+5,iTOPIC);            // extracts the help file for item1
  675.         
  676.         if (document.hhPopup) document.hhPopup.outerHTML = "";    // if hhPopup object exists, clears it
  677.  
  678.  
  679.  var  h= "<object id='hhPopup'"+ sActX_HH + "STYLE='display:none'><param name='Command' value='WinHelp, Popup'>";
  680.       h= h + "<param name='Item1' value='" + sParamHELP + "'><param name='Item2' value='" + sParamTOPIC + "'></object>";
  681.         
  682.         document.body.insertAdjacentHTML("beforeEnd", h);     
  683.         document.hhPopup.hhclick();
  684. }
  685.  
  686.  
  687. //*** callAltLocation******************************************************************************
  688. // creates an object from an <A> tag HREF, the object will navigate to the alternate location if the first location is not found.
  689. // called from: <A ID="altLoc" HREF="CHM=@@1st_chm_name.chm;Alt_chm_name.chm@@  FILE=@@1st_file_name.htm;Alt_file_name.htm@@">@@Link text here@@</A>
  690.    
  691.  
  692. function callAltLocation(eventSrc) {
  693. var e= eventSrc;
  694. var eH= unescape(e.href);
  695. var eH_= eH.toLowerCase();
  696. var sFILEarray,sCHMarray;
  697.      event.returnValue = false;
  698.      
  699.   var sParamTXT= e.innerHTML;
  700.       sParamTXT= sParamTXT.replace(semicolon,"");
  701.                                        
  702.   var iFILE = eH_.lastIndexOf("file=");
  703.         if (iFILE==-1) return;
  704.         sParamFILE= eH.substring((iFILE+5),eH.length);                  // extracts the 2 HTM files
  705.         sParamFILE= sParamFILE.replace(spaces,"");
  706.         iSPLIT= sParamFILE.match(semicolon);
  707.         if (iSPLIT)
  708.               sFILEarray = sParamFILE.split(";");                                        // separates the 2 HTM files
  709.         else return;
  710.           
  711.   var iCHM  = eH_.lastIndexOf("chm=");
  712.         if(iCHM==-1) return;
  713.         else         sParamCHM = eH.substring(iCHM+4,iFILE);            // extracts the 2 CHM's
  714.         sParamCHM= sParamCHM.replace(spaces,"");
  715.         iSPLIT= sParamCHM.match(semicolon);
  716.         if (iSPLIT)
  717.             sCHMarray= sParamCHM.split(";");                                    // separates the 2 CHM's
  718.         else return;
  719.         
  720.         sParamFILE= moniker + sCHMarray[0]+ "::/" + sFILEarray[0] + ";" + moniker + sCHMarray[1]+ "::/" + sFILEarray[1];
  721.                 
  722.         if (document.hhAlt) document.hhAlt.outerHTML = "";                // if hhAlt object exists, clears it
  723.  
  724.  
  725.   var h= "<object id='hhAlt'"+ sActX_HH + "STYLE='display:none'><PARAM NAME='Command' VALUE='Related Topics'>";
  726.       h= h + "<param name='Item1' value='" + sParamTXT +";" + sParamFILE + "'></object>";
  727.     
  728.         document.body.insertAdjacentHTML("beforeEnd", h); 
  729.         document.hhAlt.hhclick();
  730. }
  731.  
  732.  
  733. //*** callRelatedTopics******************************************************************************
  734. // creates an object from an <A> tag HREF, the object inserts a popup of the related topics to select
  735. // called from: <A ID="relTopics" HREF="CHM=@@chm_name1.chm;chm_name2.chm@@ META=@@a_filename1;a_filename2@@">Related Topics</A>
  736.    
  737.  
  738. function callRelatedTopics(eventSrc) {
  739. var e= eventSrc;
  740. var eH= unescape(e.href);
  741. var eH_= eH.toLowerCase();
  742.      event.returnValue = false;
  743.                                        
  744.   var iMETA = eH_.lastIndexOf("meta=");
  745.         if (iMETA==-1) return;
  746.         sParamMETA = eH.substring((iMETA+5),eH.length);              // extracts the META keywords for item2
  747.         
  748.   var iCHM  = eH_.lastIndexOf("chm=");
  749.         if(iCHM==-1) sParamCHM = "";
  750.         else         sParamCHM = eH.substring(iCHM+4,iMETA);            // extracts the CHM files for item1
  751.     
  752.         if (document.hhRel) document.hhRel.outerHTML = "";            // if hhRel object exists, clears it
  753.  
  754.  
  755.   var h= "<object id='hhRel'"+ sActX_HH + "STYLE='display:none'><param name='Command' value='ALink,MENU'>";
  756.       h= h + "<param name='Item1' value='" + sParamCHM + "'><param name='Item2' value='" + sParamMETA + "'></object>";
  757.     
  758.         document.body.insertAdjacentHTML("beforeEnd", h);     
  759.         document.hhRel.hhclick();
  760. }
  761.  
  762. //*** popNewWindow***************************************************************************************
  763. // creates an object from an <A> tag HREF, the object then opens a new window from the image URL found in the HREF
  764. // called from: <a id="thumbnail" title="Enlarge figure" href="CHM=NTArt.chm FILE=@@image_name.gif@@">@@alt text here@@</A>
  765. // the thumbnail image is loaded by loadPage();
  766.  
  767.  
  768. function popNewWindow(eventSrc) {
  769. var eH= eventSrc.href;
  770.       event.returnValue = false;
  771.       
  772.  // extracts the thumbnail image URL from the <a> tag HREF
  773.     sParamFILE =  getURL(eH);
  774.     if (sParamFILE=="") return;
  775.  
  776. //    alert(sParamFILE);
  777.        
  778.  // if the hhWindow object exists, clears it
  779.     if (document.hhWindow) document.hhWindow.outerHTML = "";        
  780.         
  781. var  h =  "<object id='hhWindow'"+ sActX_HH +" STYLE='display:none'><param name='Command' value='Related Topics'>";
  782.      h = h + "<param name='Window' value='$global_largeart'><param name='Item1' value='$global_largeart;" + moniker + sParamFILE+ "'> </object>";
  783.     
  784.      document.body.insertAdjacentHTML("beforeEnd", h);
  785.      document.hhWindow.hhclick();
  786. }
  787.  
  788. //*** callShortcut ***************************************************************************************
  789. // creates an object from an <A> tag, the object then calls the executable code
  790. // called from: <A ID="shortcut" HREF="EXEC=@@executable_name.exe@@ CHM=ntshared.chm FILE=@@error_file_name.htm@@">@@Shortcut text@@</A>
  791. // the shortcut image is loaded by loadInitialImg();
  792.  
  793. function callShortcut(eventSrc) {
  794. var e= eventSrc;
  795. var eH= unescape(e.href);
  796. var eH_= eH.toLowerCase();
  797.  
  798.     
  799.  
  800.     event.returnValue = false;
  801.               
  802.  // extracts the error file URL from the <a> tag HREF
  803.     iEND= eH.length;
  804.     sParamFILE =  getURL(eH);
  805.     
  806. var iEXEC = eH_.lastIndexOf("exec="); 
  807.         if (iEXEC==-1) return;
  808.         else sParamEXEC = eH.substring(iEXEC+5,iEND);                // extracts the executable for item1
  809.         
  810.         if (document.hhShortcut) document.hhShortcut.outerHTML = "";            // if the hhShortcut object exists, clears it
  811.     
  812. var  h =  "<object id='hhShortcut'"+ sActX_HH +" STYLE='display:none'> <param name='Command' value='ShortCut'>";
  813.      if(sParamFILE != "") h = h + "<param name='Window' value='" + moniker + sParamFILE+ "'>";
  814.      h = h + "<param name='Item1' value='" + sParamEXEC + "'><param name='Item2' value='msg,1,1'></object>";
  815.  
  816.         document.body.insertAdjacentHTML("beforeEnd", h);
  817.         document.hhShortcut.hhclick();
  818. }
  819.  
  820. //****************************************  EXPAND FUNCTIONS *********************************************************
  821. //********************************************************************************************************************
  822.  
  823. //**  callExpand **************************************************************************************************
  824. //  This expands & collapses (based on current state) "expandable" nodes as they are clicked.
  825. //  Called by: <A ID="expand" href="#">@@Hot text@@</A>
  826. //  Followed by:  <div class="expand">
  827.  
  828. function callExpand(eventSrc) {
  829.  
  830. var e= eventSrc;
  831.     event.returnValue = false;                    // prevents navigating for <A> tag
  832.     
  833. var oExpandable = getExpandable(e); 
  834. var oImg = getImage(e);
  835.  
  836.      if (oExpandable.style.display == "block")
  837.           doCollapse(oExpandable, oImg);
  838.      else doExpand(oExpandable, oImg);
  839. }
  840.  
  841. //** expandGoesHot *********************************************************************************************
  842. // Returns expand image to hot. 
  843.  
  844. function expandGoesHot(eventSrc){
  845. var e= eventSrc;
  846.     
  847. var oExpandable = getExpandable(e);  
  848. var oImg = getImage(e);
  849.  
  850.    if (oExpandable.style.display == "block") oImg.src = expandHot;
  851.    else oImg.src = closedHot;
  852. }
  853.  
  854.  
  855. //** expandGoesCold *********************************************************************************************
  856. // Returns expand image to cold.
  857.  
  858. function expandGoesCold(eventSrc){
  859. var e= eventSrc;
  860.  
  861. var oExpandable = getExpandable(e);   
  862. var oImg = getImage(e);
  863.  
  864.  if (oExpandable.style.display == "block") oImg.src = expand;
  865.   else oImg.src = closed;
  866.     
  867. }
  868.  
  869.  
  870. //** getExpandable *****************************[used by callExpand, expandGoesHot, expandGoesCold]*******
  871. //  Determine if the element is an expandable node or a child of one.  
  872.  
  873. function getExpandable(eventSrc){
  874. var  e = eventSrc;
  875. var iNextTag, oExpandable;
  876.     
  877.        for (var i=1;i<4; i++){
  878.                iNextTag=    e.sourceIndex+e.children.length+i;
  879.               oExpandable= document.all(iNextTag);
  880.               if (oExpandable.className.toLowerCase()=="expand" || iNextTag == document.all.length)
  881.                    break;
  882.        }
  883.        return oExpandable;
  884.        
  885. }
  886.  
  887. //**  getImage ***********************************[used by callExpand, expandGoesHot, expandGoesCold]*******
  888. //  Find the first image in the children of the current srcElement.   
  889. // (allows the  image to be placed anywhere inside the <A HREF> tag)
  890.  
  891. function getImage(header) {
  892. var oImg = header;
  893.  
  894.        if(oImg.tagName != "IMG") oImg=oImg.children.tags("IMG")(0);
  895.        return oImg;
  896. }
  897.  
  898.  
  899. //****  expandAll *******************************************************************************************************
  900. //  Will expand or collapse all "expandable" nodes when clicked. [calls closeAll()]
  901. //  called by: <A HREF="#" onclick="expandAll();">expand all</A>
  902.  
  903. var stateExpand = false;    //applies to the page 
  904.  
  905. //**** ****************************************************************************************************************
  906.  
  907. function expandAll() {
  908. var oExpandToggle, oImg;
  909. var expandAllMsg = "expand all";                    //message returned when CloseAll() is invoked
  910. var closeAllMsg = "close all";                        //message returned when ExpandAll() is invoked
  911. var e= window.event.srcElement;
  912.        event.returnValue = false;
  913.  
  914.        for (var i=0; i< document.anchors.length; i++){
  915.                oExpandToggle = document.anchors[i];
  916.          
  917.                 if (oExpandToggle.id.toLowerCase() == "expand"){ 
  918.                      oExpandable = getExpandable(oExpandToggle);  
  919.                      oImg = getImage(oExpandToggle);
  920.              
  921.                      if (stateExpand == true) doCollapse(oExpandable, oImg);
  922.                      else                     doExpand(oExpandable, oImg);
  923.                 }
  924.        }
  925.        if (stateExpand == true) {
  926.             stateExpand = false;
  927.             e.innerText= expandAllMsg;
  928.        }
  929.        else {
  930.             stateExpand = true;
  931.             e.innerText= closeAllMsg;
  932.        }
  933. }
  934.  
  935.  
  936. //****  doExpand *******************************************************************************************************
  937. //  Expands expandable block & changes image
  938.     
  939. var redo = false;    
  940. function doExpand(oToExpand, oToChange) {
  941. var oExpandable= oToExpand;
  942. var oImg= oToChange;
  943.  
  944. //    if (printing == "TRUE") return;
  945.  
  946.     oImg.src = expand;
  947.     oExpandable.style.display = "block";
  948.     
  949.     if (!redo && !isIE5) {
  950.         redo = true;
  951.         focus(oToExpand);
  952.         doExpand(oToExpand, oToChange);
  953.         }
  954.     }
  955.  
  956.  
  957. //****  doCollapse *****************************************************************************************************
  958. //  Collapses expandable block & changes image
  959.     
  960. function doCollapse(oToCollapse, oToChange) {
  961. // if (printing == "TRUE") return;
  962. var oExpandable= oToCollapse;
  963. var oImg= oToChange;
  964.  
  965.     oExpandable.style.display = "none";
  966.     oImg.src = closed;
  967. }
  968.  
  969. //*******************************************************************************************************
  970. //******* WEB  FUNCTIONS **************************************************************************
  971. //*******************************************************************************************************
  972.  
  973. //**** callThumbnailWeb **************************************************************************************
  974.  
  975. function callThumbnailWeb(eventSrc) {
  976. var e= eventSrc;
  977.        event.returnValue = false;
  978.                     
  979. var thumbnailWin= window.open (e.href, "$global_largeart",  "height=450, width=600, left=10, top=10, dependent=yes, resizable=yes, status=no, directories=no, titlebar=no, toolbar=yes, menubar=no, location=no","true");
  980.  
  981. thumbnailWin.document.write ("<html><head><title>Windows 2000</title></head><body><img src='"+e.href+"'></body></html>");
  982.  
  983. return;
  984. }
  985.  
  986. //*********************************************************************************************************
  987. //*********************************************************************************************************
  988.                                 
  989. var popupOpen= false;                //state of popups
  990. var posX, posY;                        //coordinates of popups
  991. var oPopup;                            //object to be used as popup content
  992.  
  993. //**** callPopupWeb **************************************************************************************
  994. // the web popups have been converted from the object winHelp popup for the web.
  995. // called by: <A ID="wPopupWeb" HREF="#">@@Popup text@@</A>
  996. // followed by: <div class="popup">Popup content</div>
  997.  
  998.  
  999. function callPopupWeb(eventSrc) {
  1000. var e= eventSrc;
  1001.   
  1002.   // find the popup <div> that follows <a id="wPopupWeb"></a>
  1003.   findPopup(e);
  1004.   positionPopup(e)
  1005.  
  1006.   oPopup.style.visibility = "visible";
  1007.   // document.focus(e)
  1008.   popupOpen = true;
  1009.  
  1010.   return;
  1011. }
  1012.  
  1013. //**** findPopup ****************************************************************************************
  1014.  
  1015. function findPopup(oX){
  1016. var e= oX;
  1017. var iNextTag;
  1018.     
  1019.     for (var i=1;i<document.all.length; i++){
  1020.          iNextTag=    e.sourceIndex + i;
  1021.          oPopup= document.all(iNextTag);
  1022.          if (oPopup.className.toLowerCase()=="popup" || iNextTag == document.all.length)
  1023.              break;
  1024.     }
  1025.     
  1026.     if (iNextTag != document.all.length) {
  1027.         posX = window.event.clientX; 
  1028.         posY = window.event.clientY + document.body.scrollTop+10;
  1029.     }
  1030.     if (popupOpen) closePopup();
  1031. }
  1032.  
  1033.  
  1034. //****  positionPopup ************************************************************************************
  1035. // Set size and position of popup.
  1036. // If it is off the page, move up, but not past the very top of the page.
  1037.  
  1038. function positionPopup(oX){
  1039. var e= oX;    
  1040. var popupOffsetWidth = oPopup.offsetWidth;
  1041.  
  1042. //determine if popup will be offscreen to right
  1043. var rightlimit = posX + popupOffsetWidth;
  1044.  
  1045.   if (rightlimit >= document.body.clientWidth) 
  1046.       posX -= (rightlimit - document.body.clientWidth);
  1047.   if (posX < 0) posX = 0;
  1048.     
  1049. //position popup
  1050.   oPopup.style.top = posY;
  1051.   oPopup.style.left = posX;
  1052.  
  1053. var pageBottom = document.body.scrollTop + document.body.clientHeight;
  1054. var popupHeight = oPopup.offsetHeight;
  1055.   
  1056.   if (popupHeight + posY >= pageBottom) {
  1057.       if (popupHeight <= document.body.clientHeight)
  1058.           oPopup.style.top = pageBottom - popupHeight;
  1059.       else
  1060.            oPopup.style.top = document.body.scrollTop;
  1061.   }
  1062. }
  1063.  
  1064. //**** closePopup ****************************************************************************************
  1065. // Close Popup
  1066. function closePopup() {
  1067.  
  1068.   oPopup.style.visibility = "hidden";
  1069.   popupOpen = false;
  1070.   return;
  1071. }
  1072.  
  1073.  
  1074. //*********************************************  GENERAL FUNCTIONS ************************************************
  1075. //**************************************************************************************************************************
  1076.  
  1077. //***ajustImg *************************************************************************************************************
  1078. // expands an image to the with of the window or shrinks it to 90px
  1079.  
  1080. function ajustImg(eventSrc) {
  1081. var e= eventSrc;
  1082. var fullWidth= document.body.offsetWidth;
  1083.  
  1084.     fullWidth = fullWidth - 50;
  1085.     if (e.style.pixelWidth==90)
  1086.          e.style.pixelWidth=fullWidth;
  1087.     else e.style.pixelWidth=90;
  1088. }
  1089.  
  1090.  
  1091. //**  getURL **************************************[used in callShortcut, popNewWindow& loadPage]********
  1092. // extracts the file location (CHM::/HTM) URL 
  1093.  
  1094. function getURL(sHREF) {
  1095. var spaces= /\s/g
  1096. var eH = unescape(sHREF);
  1097.     eH = eH.replace(spaces,""); 
  1098.  
  1099. var eH_= eH.toLowerCase();
  1100. var sParamFILE= "";
  1101. var sParamCHM= "";
  1102.  
  1103. var iFILE= eH_.lastIndexOf("file=");
  1104.     if (iFILE!=-1){
  1105.         iEND= iFILE +1;
  1106.         sParamFILE = eH.substring(iFILE+5,eH.length);
  1107.     }
  1108.  
  1109. var iCHM  = eH_.lastIndexOf("chm=");
  1110.      
  1111. if (gifwithin){
  1112.     gifwithin = false;
  1113.     var con_mmc;
  1114.     var doc_mmc;
  1115.     doc_mmc = " " + document.location;
  1116.     doc_mmc = doc_mmc.toLowerCase();
  1117.     if (iCHM!=-1){
  1118.         iEND  = iCHM +1;                             // iEND used by callShortcut
  1119.         sParamCHM = eH.substring(iCHM+4, iFILE);
  1120.         con_mmc = doc_mmc.indexOf(sParamCHM);
  1121.             if (con_mmc != -1){
  1122.                 sParamCHM = "";
  1123.                 iCHM = -1;
  1124.             sParamFILE= sParamCHM+sParamFILE;    
  1125.             }
  1126.         }
  1127.     }
  1128.  
  1129.      if (iCHM!=-1){
  1130.         iEND  = iCHM +1;                             // iEND used by callShortcut
  1131.         sParamCHM = eH.substring(iCHM+4, iFILE);
  1132.         sParamFILE= sParamCHM+"::/"+sParamFILE;    
  1133.         }    
  1134.     return sParamFILE;
  1135. }
  1136. //****************************************************************************************************************************
  1137. //********************************************  IE5 PERSISTENCE  *************************************************************
  1138. //****************************************************************************************************************************
  1139.  
  1140. var oTD,iTD;         // persistence
  1141.  
  1142. //****** Persistence for userData ********************************************************************************************* 
  1143.  
  1144. function getChecklistState(){ 
  1145.  
  1146.  var pageID= addID();
  1147.  
  1148.     if (checklist.all== "[object]") {
  1149.     oTD=checklist.all.tags("INPUT");
  1150.     iTD= oTD.length;
  1151.         }
  1152.     else
  1153.         {
  1154.         printing = "TRUE";
  1155.         isPersistent = false;
  1156.         return;
  1157.         }
  1158.  
  1159.     if (iTD == 0){
  1160.         printing = "TRUE";
  1161.         isPersistent = false;
  1162.         return;
  1163.         }
  1164.     
  1165. // routine added to fix a bug in the ocx 06/14/99    
  1166.      lct = document.location + ".";
  1167.      xax = 10;
  1168.      xax = lct.indexOf("mk:@MSITStore");
  1169.      if (xax != -1) {
  1170.          lct = "ms-its:" + lct.substring(14,lct.length-1);
  1171.         // alert("before reload : " + document.location);
  1172.         // alert("replace with : " + lct);
  1173.         isPersistent = false;
  1174.         document.location.replace(lct);
  1175.         isPersistent = true;
  1176.         // alert("after reload : " + document.location);
  1177.         }     
  1178.      else
  1179.          {      
  1180.          checklist.load("oXMLStore");
  1181.         }
  1182. // routine added to fix a bug in the ocx 06/14/99
  1183.     if (checklist.getAttribute("sPersist"+pageID+"0"))    
  1184.     for (i=0; i<iTD; i++){
  1185.  
  1186.          if (oTD[i].type =="checkbox" || oTD[i].type =="radio"){
  1187.          checkboxValue= checklist.getAttribute("sPersist"+pageID+i);
  1188.         
  1189.          if (checkboxValue=="yes") oTD[i].checked=true;
  1190.          else oTD[i].checked=false;
  1191.          }// if
  1192.          if (oTD[i].type =="text")              
  1193.               oTD[i].value= checklist.getAttribute("sPersist"+pageID+i);
  1194.      }// for
  1195. } // end persistence
  1196.  
  1197. //**  saveChecklistState *************************************************************************************************************
  1198. function saveChecklistState(){
  1199. var pageID= addID(); 
  1200.  
  1201.         if (!isPersistent) return; 
  1202.          //  you will need this           document.location
  1203.         for (i=0; i<iTD; i++){
  1204.  
  1205.                 if (oTD[i].type =="checkbox" || oTD[i].type =="radio"){
  1206.                  if (oTD[i].checked) checkboxValue="yes";
  1207.                  else checkboxValue="no";
  1208.                  
  1209.                  checklist.setAttribute("sPersist"+pageID+i, checkboxValue);
  1210.              }// if
  1211.             
  1212.               if (oTD[i].type =="text") 
  1213.                  checklist.setAttribute("sPersist"+pageID+i, oTD[i].value);
  1214.          }    // for
  1215.  
  1216.  // routine added to fix a bug in the ocx 06/14/99    
  1217.      lct = document.location + ".";
  1218.      xax = 10;
  1219.      xax = lct.indexOf("mk:@MSITStore");
  1220.      if (xax != -1) {
  1221.          lct = "ms-its:" + lct.substring(14,lct.length-1);
  1222.         // alert("before reload : " + document.location);
  1223.         // alert("replace with : " + lct);
  1224.         isPersistent = false;
  1225.         document.location.replace(lct);
  1226.         isPersistent = true;
  1227.         // alert("after reload : " + document.location);
  1228.         }     
  1229.      else
  1230.          {      
  1231.          checklist.save("oXMLStore");
  1232.         }
  1233. // routine added to fix a bug in the ocx 06/14/99
  1234.      
  1235. }//end function
  1236.  
  1237. //**  resizeDiv *******************************[used with callPopupWeb, setPreviousNext}****************************************************
  1238. //  resize the page when the <div class=nav></div> && <div class=text></div> are found
  1239. function resizeDiv(){
  1240. if (printing == "TRUE") return;
  1241. var oNav = document.all.item("nav");
  1242. var oText= document.all.item("text");
  1243.  
  1244.     if (popupOpen) closePopup();
  1245.     if (oText == null) return;
  1246.     if (oNav != null){
  1247.         document.all.nav.style.width= document.body.offsetWidth;
  1248.         document.all.text.style.width= document.body.offsetWidth-4;
  1249.         document.all.text.style.top= document.all.nav.offsetHeight;
  1250.         if (document.body.offsetHeight > document.all.nav.offsetHeight)
  1251.             document.all.text.style.height= document.body.offsetHeight - document.all.nav.offsetHeight;
  1252.          else document.all.text.style.height=0; 
  1253.   }
  1254. }
  1255. //**  addID *************************************************************************************************************
  1256. function addID(){
  1257.  
  1258. var locID = document.location.href; 
  1259. var iHTM = locID.lastIndexOf(".htm");
  1260. var iName=locID.lastIndexOf("/");
  1261.       locID = locID.substring(iName+1,iHTM);
  1262.     
  1263.     return locID;
  1264. }    
  1265. //** set_to_print ***************
  1266. function set_to_print(){
  1267.     
  1268.     var i;
  1269.     printing = "TRUE";
  1270.  
  1271.  
  1272.  
  1273. // trying    
  1274.  isPersistent= (document.all.item("checklist")!=null) && ((isIE5) || (isIE6));
  1275.  setPreviousNext();
  1276.  resizeDiv();
  1277.  if (isPersistent) getChecklistState();
  1278.  addReusableText();
  1279.  if (isIE55){
  1280.       insertImages();
  1281.      }
  1282. if (isIE6){
  1283.       insertImages();
  1284.      }
  1285.  
  1286. // to fix printing
  1287.  
  1288.  
  1289.     if (window.text) {
  1290.         if (!window.text.style){
  1291.             scroller = "FALSE";
  1292.             }
  1293.         else
  1294.             {
  1295.             document.all.text.style.height = "auto";
  1296.             scroller = "TRUE";
  1297.             }
  1298.         }
  1299.     
  1300. var thisLoc= document.location.href;
  1301.     thisLoc = thisLoc.indexOf("glossary.htm")
  1302.     if (thisLoc == -1){
  1303.         return;
  1304.         }
  1305.     
  1306.     // if(!isIE55 || !isIE6){
  1307.     for (i=0; i < document.all.length; i++){
  1308.         if (document.all[i].id == "expand") {
  1309.             callExpand(document.all[i]);
  1310.             single = "TRUE";
  1311.             }
  1312.         if (document.all[i].tagName == "BODY") {
  1313.             document.all[i].scroll = "auto";
  1314.             }
  1315.         if (document.all[i].tagName == "A" && scroller != "TRUE") {
  1316.             joe = " " + document.all[i].outerHTML
  1317.             joe = joe.toLowerCase();
  1318.             joe = joe.indexOf("href=")
  1319.             if(joe == -1){
  1320.                 document.all[i].outerHTML = "<A NAME=''>" + document.all[i].innerHTML + "</a>";
  1321.                 }
  1322.             else
  1323.                 {
  1324.                 document.all[i].outerHTML = "<A HREF=''>" + document.all[i].innerHTML + "</a>";
  1325.                 }
  1326.             }
  1327.         }
  1328.         //}
  1329. // reset_form();
  1330.     
  1331. }
  1332. //** used to reset a page if needed ********************
  1333. function reset_form(){
  1334.     printing = "FALSE";
  1335.     document.location.reload();
  1336. }
  1337.  
  1338.     
  1339. //** on error routine *********************************
  1340. function errorHandler() {
  1341.   // alert("Error Handled");
  1342.   return true;
  1343. }
  1344.  
  1345. //** quad method code --  Witten by Randy Feinger, morphed to work inside of shared.js
  1346. function QuadDocumentMouseOver()
  1347. {
  1348.     var elem = event.srcElement;
  1349.     
  1350.     // If the first childe of the source element is a radio button and 
  1351.     // the parent element isn't grayed, change the cursor to a hand
  1352.     // or back to the original as appropriate.
  1353.     if (elem != null && elem.firstChild != null && 
  1354.         elem.firstChild.tagName != null &&
  1355.         elem.firstChild.tagName.toLowerCase() == "input" && 
  1356.         elem.firstChild.type.toLowerCase() == "radio" && 
  1357.         elem.parentElement.className != "indentGray")
  1358.     {
  1359.         if (elem.style.cursor == "hand")
  1360.             elem.style.cursor = "auto";
  1361.         else
  1362.             elem.style.cursor = "hand";
  1363.     }
  1364. }
  1365.  
  1366. function QuadDocumentClick()
  1367. {
  1368.     // Don't process clicks on grayed text.
  1369.     if (event.srcElement.parentElement.className == "indentGray")
  1370.         return;
  1371.     
  1372.     // INPUT elements should be wrapped by another element such as a SPAN, DIV, or P.
  1373.     var elem = event.srcElement.firstChild;
  1374.     
  1375.     // If this is a radio button...
  1376.     if (elem != null && elem.tagName != null && elem.tagName.toLowerCase() == "input" && elem.type == "radio")
  1377.     {
  1378.         // check it.
  1379.         elem.checked = true;
  1380.     }
  1381.     else
  1382.     {    
  1383.         // Otherwise, set elem to the event's source element.
  1384.         elem = event.srcElement;
  1385.     }
  1386.     
  1387.     // Call OnElementClick() and pass in the source element, and the name token
  1388.     // used to mark a top-level clickable element such as a radio button.
  1389.     OnElementClick(elem, "row1");
  1390. }
  1391.  
  1392. function OnElementClick(srcElem, token)
  1393. {
  1394.     var elemTagName = srcElem.tagName;                        // Tag name of the source element.
  1395.     var collElements1 = document.all.item(srcElem.name);    // Collection of elements with the same name property as the source element.
  1396.     var n = srcElem.sourceIndex;                            // The source index of the source element.
  1397.     var elemGroup = srcElem.group;                            // The (dynamic) group property for the source element.
  1398.     var elemID = srcElem.id;                                // The source element's ID.
  1399.     var i, j, k;                                            // Loop variables.
  1400.     
  1401.     // If there are no elements with the same name as the source element, or
  1402.     // if the source element isn't part of a group, exit the function.
  1403.     if (collElements1 == null || elemGroup == null || collElements1.length == null)
  1404.         return;
  1405.     
  1406.     // Make sure the source element's name contains the designated token
  1407.     // so we know it's top-level element that should be processed.
  1408.     if (srcElem.name.toLowerCase().indexOf(token) != -1)
  1409.     {
  1410.         // Loop through the collection of 
  1411.         for (i = 0; i < collElements1.length; i++)
  1412.         {
  1413.             // Go up one level and then down a level in the element hierarchy to find
  1414.             // the container (parent) element for the clickable sub-elements (radio buttons).
  1415.             var oNextElement = collElements1(i).parentElement.nextSibling;
  1416.             
  1417.             // If there is no such element, get the next element in the collection.
  1418.             if (oNextElement == null || oNextElement.tagName == null)
  1419.                 continue;
  1420.             
  1421.             // Get the collection of all the elements within the container element that 
  1422.             // have the same tag name as the source element.
  1423.             var collElements2 = oNextElement.all.tags(elemTagName);
  1424.             
  1425.             // Make sure the collection is valid.
  1426.             if (collElements2 == null || collElements2.length == 0)
  1427.                 continue;
  1428.  
  1429.             // Loop through the collection of sub-elements within the container element.
  1430.             for (j = 0; j < collElements2.length; j++)
  1431.             {
  1432.                 // If the current element in the collection is not the
  1433.                 // source element, disable it and make the text gray.
  1434.                 if (collElements1(i).sourceIndex != n)
  1435.                 {
  1436.                     oNextElement.className = "indentGray"
  1437.                     collElements2(j).disabled = true;
  1438.                 }
  1439.                 else    // Otherwise, enable the element and make the text black.
  1440.                 {
  1441.                     oNextElement.className = "indentBlack"
  1442.                     collElements2(j).disabled = false;
  1443.                     
  1444.                     // Set the ID for the checked (selected) element for use below.
  1445.                     if (collElements2(j).tagName.toLowerCase() == "input" && 
  1446.                         collElements2(j).type.toLowerCase() == "radio" && 
  1447.                         collElements2(j).checked == true)
  1448.                     {
  1449.                         elemID = collElements2(j).id;
  1450.                     }
  1451.                 }
  1452.             }
  1453.         }
  1454.     }
  1455.     
  1456.     // Get the collection of all of the elements with the same tag name as that
  1457.     // of the source element.
  1458.     var collElements2 = document.all.tags(elemTagName);
  1459.         
  1460.     // Make sure the collection is valid.
  1461.     if (collElements2 == null || collElements2.length == 0)
  1462.         return;
  1463.         
  1464.     // Loop through the collection of elements.
  1465.     for (i = 0; i < collElements2.length; i++)
  1466.     {
  1467.         // Get the collection of all elements with the same ID as the
  1468.         // current item in the collection.
  1469.         var collAssocElems = document.all(collElements2(i).id);
  1470.                 
  1471.         // Make sure the collection is valid.
  1472.         if (collAssocElems == null || collAssocElems.length == 0)
  1473.             continue;
  1474.             
  1475.         // Loop through the collection of same-named elements.
  1476.         for (j = 0; j < collAssocElems.length; j++)
  1477.         {
  1478.             // If the tag name for the current element is different than that for the source element,
  1479.             // and the current element is part of the same group as the source element, 
  1480.             // hide or display the element as appropriate.
  1481.             if (collAssocElems(j).tagName != elemTagName && collAssocElems(j).group == elemGroup)
  1482.             {
  1483.                 // Hide the element unless the current element's ID matches the ID of the element
  1484.                 // that has been checked (selected).
  1485.                 collAssocElems(j).style.display = ((collAssocElems(j).id == elemID) ? "block" : "none")
  1486.             }
  1487.         }
  1488.     }
  1489. }
  1490.  
  1491.